home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 May / macformat-024.iso / Shareware City / Developers / TransSkel Pascal 2.5 / TransSkel / MultiSkel ƒ / common.p next >
Encoding:
Text File  |  1988-12-09  |  1.2 KB  |  67 lines  |  [TEXT/PJMM]

  1. {    Common Unit.  Contains several routines which are used by several of}
  2. {the othe units.  }
  3. {Written 7 January 1987 Owen Hartnett, Ωhm Software Co.}
  4.  
  5. unit common;
  6.  
  7. interface
  8.  
  9.     uses
  10. {$IFC UNDEFINED THINK_PASCAL}
  11.         Memtypes, Quickdraw, OSIntf, ToolIntf, PackIntf, 
  12. {$ENDC}
  13.         multiSkelGlobals;
  14.  
  15.  
  16.     procedure DrawGrowBox (wind: WindowPtr);
  17.     procedure SetWindClip (wind: WindowPtr);
  18.     procedure ResetWindClip;
  19.  
  20. implementation
  21.  
  22.     var
  23.         oldClip: RgnHandle;
  24.  
  25. {    Miscellaneous routines}
  26. {    These take care of drawing the grow box and the line along}
  27. {    the right edge of the window, and of setting and resetting the clip}
  28. {    region to disallow drawing in that right edge by the other drawing}
  29. {    routines.}
  30.  
  31.     procedure DrawGrowBox;
  32.  
  33.         var
  34.             r: Rect;
  35.             oldClip: RgnHandle;
  36.  
  37.     begin
  38.         r := wind^.portRect;
  39.         r.left := r.right - 15;        { draw only along right edge }
  40.         oldClip := NewRgn;
  41.         GetClip(oldClip);
  42.         ClipRect(r);
  43.         DrawGrowIcon(wind);
  44.         SetClip(oldClip);
  45.         DisposeRgn(oldClip);
  46.     end;
  47.  
  48.     procedure SetWindClip;
  49.  
  50.         var
  51.             r: Rect;
  52.  
  53.     begin
  54.         r := wind^.portRect;
  55.         r.right := r.right - 15;        { don't draw along right edge }
  56.         oldClip := NewRgn;
  57.         GetClip(oldClip);
  58.         ClipRect(r);
  59.     end;
  60.  
  61.     procedure ResetWindClip;
  62.  
  63.     begin
  64.         SetClip(oldClip);
  65.         DisposeRgn(oldClip);
  66.     end;
  67. end.